package com.llk.rabbitmqlearn.consumer;

import com.llk.rabbitmqlearn.config.RabbitConfig;
import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 报警队列消费者
 */
@Slf4j
@Component
public class BackupConsumer {

    @RabbitListener(queues = RabbitConfig.WAINING_QUEUE)
    public void received(Message message, Channel channel) {
        String msg = new String(message.getBody());
        log.error("报警队列收到转发来的消息：{}", msg);
    }
}
